<template>
  <svg :style="{ width: size + 'em', height: size + 'em' }">
    <use :xlink:href="prefix + name" :fill="color"></use>
  </svg>
</template>

<script setup lang="ts">
defineProps({
  //前缀
  prefix: {
    type: String,
    default: '#icon-'
  },
  //图标名称
  name: String,
  //颜色
  color: {
    type: String,
    default: ''
  },
  //宽高，不传入默认为30px
  size: {
    type: String,
    default: '2em'
  }
})
</script>

<style scoped></style>
